<html>
	<head>
        <title>便签</title>
		<!--Air -->
		<script type="text/javascript" src="lib/air1.5/AIRAliases.js"></script>
        <script type="text/javascript" src="lib/air1.5/AIRIntrospector.js"></script>
		<script type="text/javascript" src="lib/ext-core-3.0/ext-core.js"></script>
<script type="text/javascript">
JS={};        
/**
 * Copies all the properties of config to obj.
 * @param {Object} obj The receiver of the properties
 * @param {Object} config The source of the properties
 * @return {Object} returns obj
 * @member JS apply
 */
JS.apply = function(o, c){
    if(o && c && typeof c == 'object'){
        for(var p in c){
            o[p] = c[p];
        }
    }
    return o;
};        
function createWindow(option){
	var transparent = option.transparent || false;
	if(transparent){
		window.htmlLoader.paintsDefaultBackground = false;
	}
	var chrome = option.chrome || air.NativeWindowSystemChrome.STANDARD;//选项可以是：none,standard
	var type = option.type || air.NativeWindowType.NORMAL;//选项可以是：normal ,utility ,lightweight
	var title = option.title || '';
	var width = option.width || 600;
	var height = option.heigth || 400;
	var file = option.file;
	var html = option.html;
	//初始化配置参数
	var options = new air.NativeWindowInitOptions();
	options.transparent = transparent;
	options.systemChrome = chrome;
	options.type = type;
	
	var loader = window.runtime.flash.html.HTMLLoader.createRootWindow(false, options, false);
	if (file) {
		loader.load(new air.URLRequest(file));	
	} else {
		loader.loadString(html || '');
	}
	return loader.window.nativeWindow ;
}
var note = createWindow({
	transparent : false,
	chrome : "none",
	type : "utility",
	width : 200,
	height : 100,
	html:'xxx'
});
function createNativeWindow() { 
    //create the init options 
    var options = new air.NativeWindowInitOptions(); 
    options.transparent = false; 
    options.systemChrome = air.NativeWindowSystemChrome.STANDARD; 
    options.type = air.NativeWindowType.NORMAL; 
     
    //create the window 
    var newWindow = new air.NativeWindow(options); 
    newWindow.title = "A title"; 
    newWindow.width = 600; 
    newWindow.height = 400; 
     
    //activate and show the new window 
    newWindow.activate(); 
}
//note.visible = true;
//note.activate();
alert(typeof nativeWindow);
        </script>
	</head>

    <body>
       
        
    </body>
</html>